package uk.ac.staffs.student.autopilot.views;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;

import javax.swing.JFrame;

import org.apache.log4j.Logger;

import uk.ac.staffs.student.autopilot.AutoPilotApp;
import uk.ac.staffs.student.autopilot.AutoPilotInterface;

/**
 * A Swing UI View for Autopilot HCI Displays various values received serial
 * port manager.
 * 
 * @author pgoudman
 * 
 */
public class ApHciSwingUI extends JFrame {

    /**
     * 
     */
    private static final long serialVersionUID = 1L;
    public static Logger logger = Logger.getLogger(ApHciSwingUI.class);
    
    private AutoPilotInterface controller;
    private final APHciSwingPanelRv2 autopilotPanel;
    //private final JFrame mainFrame;

    public ApHciSwingUI(AutoPilotInterface controller) {
        super("AutoPilot HCI");
        this.controller = controller;
        autopilotPanel = new APHciSwingPanelRv2(controller);
        init();
        //autopilotPanel.getMode1Btn().addActionListener(this);
//        mainFrame = new JFrame("AutoPilot HCI");
//        mainFrame.setBounds(100, 100, 850, 600);
//        mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//        mainFrame.add(autopilotPanel);
//        mainFrame.pack();
//        mainFrame.setVisible(true);
    }
    private void init() {
        setBounds(100, 100, 850, 600);
        add(this.autopilotPanel);
        pack();
        setVisible(true);
    }


    public APHciSwingPanelRv2 getViewPanel() {
        return autopilotPanel;
    }

    
}
